package com.example.homework2.Interface;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.GridLayout;

import androidx.appcompat.app.AppCompatActivity;

import com.example.homework2.R;

public class UC5 extends AppCompatActivity {

    GridLayout button_linearlayout;
    Button back;

    String[] layout_name = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "-", "*", "/", "="};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_uc5);

        button_linearlayout = findViewById(R.id.button_linearlayout);
        back = findViewById(R.id.back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        for (int i = 0; i < layout_name.length; i++) {
            View view = LayoutInflater.from(this).inflate(R.layout.button_layout, null);
            Button which_layout = view.findViewById(R.id.which_layout);
            which_layout.setText(layout_name[i]);
            button_linearlayout.addView(view);
        }
    }
}